<?php
namespace app\modules\adminapi\controllers;

use fate\http\Request;
use app\models\Nav;

class GetnavController extends \app\modules\adminapi\ForceLoginPure {

    public function run() {
        $req = Request::getInstance();

        $id = $req->getQueryString('id');
        if(!is_numeric($id)) {
            $this->ajaxReturn(null, 300002);
            exit;
        }

        $model = new Nav();
        $ret = $model->getOne('id,pid,title,navurl,listorder,linktype', $id);

        $this->ajaxReturn([
            'data' => $ret
        ]);
    }

}
